//
//  MKImageData.swift
//  MKPhotoDetailDemo
//
//  Created by 劢克科技 on 2019/3/26.
//  Copyright © 2019 劢克科技. All rights reserved.
//

import UIKit

class MKImageData: NSObject {
    var originImageView = UIImageView()
    var browseImageView = UIImageView()
    var imageUrl: URL?
    
    var videoUrl: URL?
    
    var textInfo = false
    var username = ""
    var sortname = ""
    var content = ""
    var time = ""
    
    func setupTextInfo(title: String, desc: String, content: String, date: String) {
        self.username = title
        self.sortname = desc
        self.content = content
        self.time = date
        self.textInfo = true
    }
    
    var isImage: Bool  {
        return videoUrl == nil
    }
    
    func originFrame() -> CGRect {
        let frame = originImageView.convert(originImageView.frame, from: UIApplication.shared.keyWindow)
        return CGRect(x: abs(frame.origin.x), y: abs(frame.origin.y), width: frame.width, height: frame.height)
    }
}
